<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      class Person {
        say() {
          console.log(1);
        }
      }
      class User extends Person {
        say() {
          console.log(2);
        }
      }

      /*
      原型链
        1. u对象->User.prototype->Person.prototype->Object.prototype->null  ✔
        2. u->u.__proto__->u.__proto__.__proto__->... ❌
      */
      const u = new User();
      u.say();
    </script>
  </body>
</html>
